filter dataframe columns vy a list of columns

134

filter dataframe columns vy a list of columns -

df.loc[:, df.columns.isin(['nnn', 'mmm', 'yyy', 'zzzzzz'])]

   yyy  nnn  mmm
0   10    5    5
1    9    3    4
2    8    7    0

Comments

Submit
0 Comments